package com.github.chain.admin.client;

import com.github.chain.admin.common.domain.Menu;
import com.github.chain.admin.common.domain.User;
import com.github.chain.admin.common.request.UserRequest;
import com.github.framework.core.Result;
import com.github.framework.core.page.DataPage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "admin-server")
@RestController
public interface UserServiceClient {

    @GetMapping("/findUserByUserName")
    Result<User> findUserByUserName(@RequestParam("userName") String userName);

    @PostMapping("/findUserByPage")
    Result<DataPage<User>> findUserByPage(@RequestBody UserRequest userRequest);

    @GetMapping("/findUserById/{id}")
    Result<User> findUserById(@PathVariable("id") Long id);

    @PostMapping("/saveUser")
    Result<Integer> saveUser(@RequestBody UserRequest userRequest);

    @PostMapping("/updateUser")
    Result<Integer> updateUser(@RequestBody UserRequest userRequest);

    @GetMapping("/deleteUserById/{id}")
    Result deleteUserById(@PathVariable("id") Long id);

    @PostMapping("/enableUserStatus")
    Result enableUserStatus(@RequestBody List<Long> ids);

    @PostMapping("/disableUserStatus")
    Result disableUserStatus(@RequestBody List<Long> ids);

    @PostMapping("/modifyUserPassword")
    Result<Integer> modifyUserPassword(@RequestBody UserRequest userRequest);

    @GetMapping("/roleAssignmentById/{id}")
    Result<User> roleAssignmentById(@PathVariable("id") Long id);

    @PostMapping("/authUserRole")
    Result authUserRole(@RequestBody UserRequest userRequest);

}
